package com.chris.design.pattern.samples.factory;

/**
 * 饿汉式单例模式
 */
public class EagerSingleton {

    /**
     *  类加载即创建新对象，空间换时间，性能不好
     */
    private static EagerSingleton instance = new EagerSingleton();

    private EagerSingleton() {
    }

    public static EagerSingleton getInstance() {
        return instance;
    }
}
